package com.hrm.pojo;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "t_trainning")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Trainning {
	private String id;
	private String kechengname;
	private String category;
	private String depart;
	private String begindate;
	private String enddate;
	private String keshi;
	private TrainAgency agency;
	private List<Working> workerList;
	
	@Id
	@GenericGenerator(name = "pk",strategy = "uuid")
	@GeneratedValue(generator = "pk")
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getKechengname() {
		return kechengname;
	}
	public void setKechengname(String kechengname) {
		this.kechengname = kechengname;
	}
	public String getCategory() {
		return category;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	public String getDepart() {
		return depart;
	}
	public void setDepart(String depart) {
		this.depart = depart;
	}
	public String getBegindate() {
		return begindate;
	}
	public void setBegindate(String begindate) {
		this.begindate = begindate;
	}
	public String getEnddate() {
		return enddate;
	}
	public void setEnddate(String enddate) {
		this.enddate = enddate;
	}
	public String getKeshi() {
		return keshi;
	}
	public void setKeshi(String keshi) {
		this.keshi = keshi;
	}
	
	@ManyToOne
	@JoinColumn(name = "agencyid")
	public TrainAgency getAgency() {
		return agency;
	}
	public void setAgency(TrainAgency agency) {
		this.agency = agency;
	}
	
	@ManyToMany
	@JoinTable(name = "t_work_trainning",joinColumns = @JoinColumn(name = "trainid"),inverseJoinColumns = @JoinColumn(name = "workid"))
	public List<Working> getWorkerList() {
		return workerList;
	}
	public void setWorkerList(List<Working> workerList) {
		this.workerList = workerList;
	}
	
	

}
